In various network devices including switches and routers, packets are inspected in order to identify the type of traffic. Various forwarding decisions and or quality of service policies may then be applied to the packet depending on the type of flow. In many contemporary devices, one or more fields are extracted from the packet and concatenated to form a single search term with which the search is conducted. In many cases, the single term includes one or more bits from the destination address and source address fields of the packet. If there is a complete match between the packet and the criteria representing the policy, the associated policy is applied to the packet. In the absence of a match, a generic default rule may be applied. While the prior art is able to identify and classify a traffic flow that satisfies each criterion, the prior art is generally unable to take advantage of any benefit to be derived from a partial match. There is therefore a need for a method and system for, among other things, classifying a packet by exploiting known properties of the packet even in the absence of a complete match with a policy.